import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/index.vue'
import BasisRouter from './modules/basis.js'
import SystemRouter from './modules/system.js'
import LeadRouter from './modules/lead.js'
import BusinessRouter from './modules/business.js'
import ContractRouter from './modules/contract.js'
import CountRouter from './modules/count.js'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/dashboard',
      component: Layout,
      meta: { title: '首页' },
      children: [
        {
          path: 'dashboard',
          component: () => import('@/views/dashboard/index.vue'),
          meta: { title: '首页' }
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
      hidden: true
    },
    {
      path: '/',
      name: 'dashboard',
      component: Layout,
      hidden: true
    },
    LeadRouter,
    BusinessRouter,
    ContractRouter,
    BasisRouter,
    CountRouter,
    SystemRouter
  ]
})

export default router
